package vip.xiaonuo.modular.business.adapter.IndexDataAnalysis;

import liquibase.pro.packaged.B;
import org.springframework.stereotype.Component;
import vip.xiaonuo.modular.business.entity.BiIndexData.AnalysisData.pop.PopData;
import vip.xiaonuo.modular.business.entity.BiIndexData.AnalysisData.roadNetwork.RoadNetworkLength;
import vip.xiaonuo.modular.business.entity.BiIndexData.AnalysisData.roadNetwork.RoadNetworkRatio;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

/**
 * @Description
 * @Author cy
 * @Date 2022/8/5 14:33
 * @Version 1.0
 */
@Component
public class RoadNetworkAdapter implements AbstractAdapter{
    @Override
    public List<Object> additionData() {
        List<Object> result = new ArrayList<>();
        RoadNetworkRatio rr = new RoadNetworkRatio();
        rr.setName("省道");
        rr.setRatio(new BigDecimal(30));
        RoadNetworkRatio rr1 = new RoadNetworkRatio();
        rr1.setName("国道");
        rr1.setRatio(new BigDecimal(40));
        RoadNetworkRatio rr2 = new RoadNetworkRatio();
        rr2.setName("高速公路");
        rr2.setRatio(new BigDecimal(30));
        List<RoadNetworkRatio> rrlist = new ArrayList<>();
        rrlist.add(rr);
        rrlist.add(rr1);
        rrlist.add(rr2);

        RoadNetworkLength rl = new RoadNetworkLength();
        rl.setName("省道");
        rl.setLength(new BigDecimal(50032.12));
        RoadNetworkLength rl1 = new RoadNetworkLength();
        rl1.setName("国道");
        rl1.setLength(new BigDecimal(7032.12));
        RoadNetworkLength rl2 = new RoadNetworkLength();
        rl2.setName("高速公路");
        rl2.setLength(new BigDecimal(536.12));
        List<RoadNetworkLength> rllist = new ArrayList<>();
        rllist.add(rl);
        rllist.add(rl1);
        rllist.add(rl2);

        PopData popData1 = new PopData();
        popData1.setName("不同路网比例");
        popData1.setObj(rrlist);
        PopData popData = new PopData();
        popData.setName("不同路网长度");
        popData.setObj(rllist);

        result.add(popData);
        result.add(popData1);
        return result;
    }
}
